function checkYuanAmount(amount) {
	var tmpAmount = '';
	for(var i = 0;i < amount.length; i++) {
		var temp = amount.substr(i, 1);
		if(temp == '0' || temp == '1' || temp == '2' || temp == '3' || temp == '4' || temp == '5' || temp == '6' || temp == '7' || temp == '8' || temp == '9' || temp == '.') {
			tmpAmount += temp;
		}
	}
	while(tmpAmount.substr(0, 1) == '0') {
		if(tmpAmount.substr(1, 1) == '.') {
			break;
		} else {
			tmpAmount = tmpAmount.substr(1, tmpAmount.length);
		}
	}
	if(tmpAmount.substr(0, 1) == '.' || tmpAmount.length == 0) {
		tmpAmount = '0' + tmpAmount; 
	}
	var pos = tmpAmount.indexOf('.');
	var len = tmpAmount.length;
	if(pos > 0) {
		if(len - 1 == pos) {
			tmpAmount = tmpAmount.substr(0, pos);
		} else if (len - 1 > pos + 2) {
			tmpAmount = tmpAmount.substr(0, pos + 3);
		}
	}
	return tmpAmount;
}

function checkYuanAmountN(amount) {
	var isNegative = false;
	if (amount.substr(0, 1) == '-') {
		amount = amount.substr(1, amount.length - 1);
		isNegative = true;
	}
	var tmpAmount = '';
	for(var i = 0;i < amount.length; i++) {
		var temp = amount.substr(i, 1);
		if(temp == '0' || temp == '1' || temp == '2' || temp == '3' || temp == '4' || temp == '5' || temp == '6' || temp == '7' || temp == '8' || temp == '9' || temp == '.') {
			tmpAmount += temp;
		}
	}
	while(tmpAmount.substr(0, 1) == '0') {
		if(tmpAmount.substr(1, 1) == '.') {
			break;
		} else {
			tmpAmount = tmpAmount.substr(1, tmpAmount.length);
		}
	}
	if(tmpAmount.substr(0, 1) == '.' || tmpAmount.length == 0) {
		tmpAmount = '0' + tmpAmount; 
	}
	var pos = tmpAmount.indexOf('.');
	var len = tmpAmount.length;
	if(pos > 0) {
		if(len - 1 == pos) {
			tmpAmount = tmpAmount.substr(0, pos);
		} else if (len - 1 > pos + 2) {
			tmpAmount = tmpAmount.substr(0, pos + 3);
		}
	}
	if(isNegative) {
		return '-' + tmpAmount;
	} else {
		return tmpAmount;
	}
}

function formatYuanAmount(amount) {
	var tmpAmount = '';
	for(var i = 0;i < amount.length; i++) {
		var temp = amount.substr(i, 1);
		if(temp == '0' || temp == '1' || temp == '2' || temp == '3' || temp == '4' || temp == '5' || temp == '6' || temp == '7' || temp == '8' || temp == '9' || temp == '.') {
			tmpAmount += temp;
		}
	}
	if(tmpAmount.substr(0, 1) == '.' || tmpAmount.length == 0) {
		tmpAmount = '0' + tmpAmount; 
	}
	var pos = tmpAmount.indexOf('.');
	var len = tmpAmount.length;
	if(pos > 0) {
		if(len - 1 == pos) {
			tmpAmount += '00';
		} else if (len - 1 > pos + 2) {
			tmpAmount = tmpAmount.substr(0, pos + 3);
		} else if (len - 1 > pos && len - 1 < pos + 2) {
			tmpAmount += '0';
		}
	} else {
		tmpAmount += '.00';
	}
	return tmpAmount;
}

function formatYuanAmountN(amount) {
	var isNegative = false;
	if (amount.substr(0, 1) == '-') {
		amount = amount.substr(1, amount.length - 1);
		isNegative = true;
	}
	var tmpAmount = '';
	for(var i = 0;i < amount.length; i++) {
		var temp = amount.substr(i, 1);
		if(temp == '0' || temp == '1' || temp == '2' || temp == '3' || temp == '4' || temp == '5' || temp == '6' || temp == '7' || temp == '8' || temp == '9' || temp == '.') {
			tmpAmount += temp;
		}
	}
	if(tmpAmount.substr(0, 1) == '.' || tmpAmount.length == 0) {
		tmpAmount = '0' + tmpAmount;
	}
	var pos = tmpAmount.indexOf('.');
	var len = tmpAmount.length;
	if(pos > 0) {
		if(len - 1 == pos) {
			tmpAmount += '00';
		} else if (len - 1 > pos + 2) {
			tmpAmount = tmpAmount.substr(0, pos + 3);
		} else if (len - 1 > pos && len - 1 < pos + 2) {
			tmpAmount += '0';
		}
	} else {
		tmpAmount += '.00';
	}
	if(isNegative) {
		return '-' + tmpAmount;
	} else {
		return tmpAmount;
	}
}

function date2strYYYYMMDD(date) {
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	var day = date.getDate();
	if (month < 10) {
		month = '0' + month;
	}
	if (day < 10) {
		day = '0' + day;
	}
	return year + '-' + month + '-' + day;
}

function date2strYYYYMM01(date) {
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	var day = '01';
	if (month < 10) {
		month = '0' + month;
	}
	return year + '-' + month + '-' + day;
}